package init

import (
	"fmt"
	"github.com/elastic/go-elasticsearch/v7"
	"video-srv/basic/config"
)

func InitEs() {
	var err error
	config.Es, err = elasticsearch.NewClient(elasticsearch.Config{
		Addresses: []string{
			config.AppCfg.Es.Address,
		},
	})
	if err != nil {
		panic(err)
	}
	fmt.Println("es 连接成功")
}
